﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Text;

public class TestItemMa : MonoBehaviour
{

    // Use this for initialization
    void Start()
    {
        ItemMa.I.TestInit();
        Dictionary<int, object> search = new Dictionary<int, object>();
        search.Add(EItemSearch.ConfigId, 101);
        search.Add(EItemSearch.Bind, true);

        //第一次搜索
        List<ItemBase> itemList = ItemMa.I.Get(search);
        PrintItem(itemList);

        //第二次搜索
        search.Clear();
        search.Add(EItemSearch.Bind, false);
        itemList = ItemMa.I.Get(search);
        PrintItem(itemList);
    }

    public static void PrintItem(List<ItemBase> itemList)
    {
        StringBuilder sb = new StringBuilder();
        foreach (var item in itemList)
        {
            sb.AppendLine("Name: " + item.Name);
            sb.AppendLine("Id: " + item.ConfigId);
            sb.AppendLine("Bind: " + item.Bind);
            sb.AppendLine("BigType: " + item.BigType);
            sb.AppendLine("SubType: " + item.SubType);
            sb.AppendLine("TimeType: " + item.TimeType);
            sb.AppendLine("");
        }
        PLDebug.Log(sb.ToString());
    }

}
